from apis import create_app
import uvicorn
import logging
from utils.config_utils import config_get_value

app = create_app()

# 设置日志
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)


if __name__ == "__main__":

    port = config_get_value("server", "port", "")
    logger.info(f"Server started port: {port} ----->")
    if port:
        try:
            uvicorn.run(app=app, host="0.0.0.0", port=int(port))
        except Exception as e:
            logger.info("e:{}".format(e))
    logger.info("Server stopped ----->")



